<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@ page import="java.util.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	request.setCharacterEncoding("utf8");
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
<script type="text/javascript" src="js/bootstrap.js"></script>
<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css"
	type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title></title>
</head>


<body>
	<%@ include file="/adminHeader.jsp"%>
	<div class="container">
		<br> <br> <img src="${requestScope.user.picture}"
			style="length: 300px; width: 200px; border: 1px solid lightgray" /> <br>
		<br>
		<form class="form" id="f1" method="post" action="userManager/update"
			enctype="multipart/form-data">


			<input type="hidden" name="id" value="${requestScope.user.id}">
		
			<div class="form-group">
				<label>用户名</label>
				<div class="controls">
					<input class="form-control" type="text" name="username"
						value="${requestScope.user.username}" />
				</div>
			</div>

			<div class="form-group">
				<label>头像</label>
				<div class="controls">
					<input class="form-control" type="file" name="pictureFile" /> 
					<input type="hidden" name="picture" value="${requestScope.user.picture}" />
				</div>
			</div>
			<div class="form-group">
				<label>权限</label>
				<c:forEach items="${requestScope.allRoles}" var="role">
				
				<div class="form-check">
					<input class="form-check-input" type="checkbox" value="${role.id}" ${requestScope.roleChecks.get(role.id)}
						name="roles"> <label
						class="form-check-label" for="flexCheckCheckedDisabled">
						${role.roleName} </label>
				</div>
		
				</c:forEach>
			</div>
			<button type="submit" class="btn btn-primary">
				<i class="fa fa-check">修改</i>
			</button>
			<button type="reset" class="btn btn-danger">
				<i class="fa fa-trash">返回</i>
			</button>




		</form>

	</div>


</body>
</html>